package org.csmzxy2334;

public class 水仙花 {
    public static boolean isNarcissistic(int number) {
        int hundreds = number / 100;
        int tens = (number % 100) / 10;
        int units = number % 10;
        int sumOfCubes = (int) (Math.pow(hundreds, 3) + Math.pow(tens, 3) + Math.pow(units, 3));
        return sumOfCubes == number;
    }
    public static void main(String[] args) {
        int testNumber = 153;
        boolean result = isNarcissistic(testNumber);
        System.out.println(testNumber + " 是否为水仙花数: " + result);
    }
}
